package com.orange.cetback.controller.user;

import com.orange.cetback.common.context.BaseContext;
import com.orange.cetback.common.vo.Result;
import com.orange.cetback.pojo.entity.MedalLevel;
import com.orange.cetback.pojo.entity.UserMedal;
import com.orange.cetback.service.UserMedalService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author chenenjun
 * @since 2025-04-02
 */
@Tag(name = "用户勋章接口")
@Slf4j
@RestController
@RequestMapping("/userApi/userMedal")
public class UserMedalController {
    @Autowired
    private UserMedalService userMedalService;

    @Operation(summary = "获取全部勋章信息")
    @GetMapping("/list")
    public Result<List<MedalLevel>> getUserMedalList() {
        List<MedalLevel> list = userMedalService.getUserMedalList(BaseContext.getCurrentId());
        return Result.success(list);
    }
}
